home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
bixdos.arc
/
INT2F
< prev
next >
Wrap
Text File
|
1986-11-24
|
5KB
|
132 lines
TITLE: Documentation for INT 2FH
The 2F Hex DOS interrupt will, starting with versions 3.0
and above, be referred to as the Multiplex interrupt. A
general interface has been defined to allow "Fakey" IPC
between two processes. The definition of specific functions
and parameters is left to the specific application using the
interrupt, what is defined here is the common ground between
all Multiplex Interrupt handlers/users.
Every Multiplex Interrupt handler is assigned a specific
multiplex number which is always specified in the AH register.
Handlers are chained into the INT 2FH interrupt vector and
discriminate based on the AH value. The specific function to
be performed is placed in the AL register. Other parameters
are placed in the other registers as needed.
MULTIPLEX NUMBERS AH=0 through AH=7FH are reserved for DOS
use. Other apps should use multiplex numbers 80H-FFH. There
is no mechanism for getting a multiplex number "assigned".
You must just pick one. This makes it possible to have two
different 2F users which cannot run at the same time because
they are both trying to use the same multiplex number. To
prevent this the multiplex number(s) used by an application
should be patchable, so that a user can change it to prevent
conflicts with another application.
Several of the AL function values are predefined or reserved:
AL = 0 Get Installed State
This call MUST be defined by ALL INT 2FH
handlers and is used by a potential caller of
the handler to determine if the handler is
present. The installed state is returned in
the AL register:
AL = 0 Not installed, OK to install.
AL = 1 Not installed, NOT OK to install.
AL = FF Installed.
NO OTHER REGISTERS MAY BE MODIFIED.
Note that the return of 0 (AL not modified) is
not actually set by a handler. It results
from the request being passed through all of
the INT 2FH handlers without any of them
processing it. The 1 return can be used to
provide mutual exclusion between two or more
different 2F users which must not both be
installed at the same time.
AL = F8 - FF Reserved.
These call numbers are reserved for future
standard call expansion. ALL Current INT 2FH
handlers must return from these calls WITHOUT
MODIFYING ANY REGISTERS (including AX).
EXAMPLE 2F Handler:
MYNUM EQU X ; X = the specific AH multiplex number.
INT_2F_NEXT DD ? ; Chain location
INT_2F:
ASSUME DS:NOTHING,ES:NOTHING,SS:NOTHING
CMP AH,MYNUM
JE MINE
JMP INT_2F_NEXT ; Chain to next 2FH Handler
MINE:
CMP AL,0F8H
JB DO_FUNC
IRET ; IRET on reserved functions
DO_FUNC:
OR AL,AL
JNE DISP_FUNC ; A non GET INSTALLED STATE req
MOV AL,0FFH ; Say I'm here
IRET ; All done
DISP_FUNC:
.
.
.
HERE IS A CODE SAMPLE FOR INSTALLING THE ABOVE HANDLER:
.
.
.
MOV AH,MYNUM
XOR AL,AL
INT 2FH ; Ask if already installed
OR AL,AL
JZ OK_INSTALL
BAD_INSTALL: ; Handler already installed
.
.
.
OK_INSTALL:
MOV AL,2FH
MOV AH,GET_INTERRUPT_VECTOR
INT 21H ;Get multiplex vector
MOV WORD PTR INT_2F_NEXT+2,ES
MOV WORD PTR INT_2F_NEXT,BX
MOV DX,OFFSET INT_2F
MOV AL,2FH
MOV AH,SET_INTERRUPT_VECTOR
INT 21H ;Set multiplex vector
.
.
.
NOTE WARNING DANGER:
BECAUSE OF THE CHAINING OF THE 2F VECTOR IT IS NOT GENERALLY
POSSIBLE TO REMOVE A 2FH HANDLER FROM THE SYSTEM. IT CAN BE
DONE IF IT IS KNOWN THAT THE HANDLER IS THE FIRST ONE IN THE
LIST (VECTOR LOCATION IN INTERRUPT TABLE POINTS TO IT), OR IT
IS KNOWN WHICH OF THE OTHER HANDLERS POINTS TO IT, AND IT IS
KNOWN HOW TO PATCH THAT HANDLER.